<template>
  <div>
  <el-dialog :title="title" :visible.sync="dialogFormVisible" width="500px">
    <el-divider></el-divider>
    <el-form v-model="row" style="margin: 30px 150px 30px 50px;">
      <el-form-item>
        <el-input v-model="row.checkPersonContact" placeholder="审核人联系电话/QQ"></el-input>
      </el-form-item>
      <el-form-item>
        <el-input type="textarea" rows="4" v-model="row.checkRemark" placeholder="请输入审核失败原因(非必填)"></el-input>
      </el-form-item>
    </el-form>
    <el-divider></el-divider>
    <div slot="footer" class="dialog-footer">
      <el-button @click="dialogFormVisible = false">取消审核</el-button>
      <el-button type="primary" @click="update">确 定</el-button>
    </div>
  </el-dialog></div>
</template>

<script>
  export default {
    data() {
      return {
        dialogFormVisible: false,
        title: "审核失败",
        row: [],
        id: 0,
      }
    },
    mounted() {
      // this.parent.getData();
    },
    methods: {
      // 拒绝审核
      update(row) {
        var tt = new Date(); //获取时间
        this.row.checkTime = tt.getFullYear()+"-"+tt.getMonth()+1+"-"+tt.getDate()+" "+tt.getHours()+":"+tt.getMinutes()+":"+tt.getSeconds();
        this.row.id = this.id;
        this.row.checkStatus = 3;
        console.log(this.row);
        this.$axios.request({
          url: this.API + "/activity/activity/update",
          data: {
            id: this.row.id,
            checkTime: this.row.checkTime,
            checkStatus: this.row.checkStatus,
            checkPersonContact: this.row.checkPersonContact,
            checkRemark: this.row.checkRemark
          },
          method: "post"
        }).then((res)=>{
          if(res.data.code == 0){
            this.$message.success("拒绝审核成功");
            this.parent.getData();
            this.dialogFormVisible = false;
            this.row = [];
          }else{
            this.$message.error(res.data.msg);
          }
        })
      },
    },
    props: ['parent']
  }
</script>

<style>
</style>
